package com.example.demo.javatest.thread.tongxin;

/**
 * Created by liujiahao on 2019/3/13.
 */
public class ThreadTest {
    public static void main(String[] args) {
        Object lock=new Object();
        Object lock1=new Object();
        DbTools db=new DbTools();
        Service service=new Service();
        ThreadA a=new ThreadA(lock,service,db);
        a.setName("a");
        a.start();
        try {
            a.join();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("main");
       /* for (int i = 0; i <5 ; i++) {
            ThreadA a=new ThreadA(lock,service,db);
            a.setName("a");
            a.start();
            ThreadB b=new ThreadB(lock,service,db);
            b.setName("b");
            b.start();
        }*/


    }
}
